<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="mathematica——代数操作, 我心永恆的小站">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>mathematica——代数操作 | 我心永恆的小站</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="/css/vs2015.css">

<meta name="generator" content="Hexo 4.2.0"><link rel="alternate" href="/atom.xml" title="我心永恆的小站" type="application/atom+xml">
</head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">我心永恆的小站</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>

<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">我心永恆的小站</div>
        <div class="logo-desc">
            
            Never really desperate, only the lost of the soul.
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
    </ul>
</div>

        </div>

        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/8.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">mathematica——代数操作</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        height: calc(100vh - 250px);
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/%E6%95%99%E7%A8%8B/">
                                <span class="chip bg-color">教程</span>
                            </a>
                        
                            <a href="/tags/Mathematica/">
                                <span class="chip bg-color">Mathematica</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-03-15
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2020-03-25
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    3.1k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    14 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>

        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2>0介绍</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 代数可分为初等代数和抽象代数。初等代数是我们在高中都学过的。Mathematica可以很好地解决初等代数中的问题，本章中的许多案例向您展示了如何利用这些特性。Mathematica目前还没有对抽象代数的深入支持，抽象代数涉及到组、环和字段等构造。但是，有一些第三方的包可以用来研究抽象代数，我提供了一些参考。 </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>1.解代数方程组</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3>问题</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 你要解一个含未知数的代数方程</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>解决方案</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 使用  Solve 处理<strong>left-hand-side</strong>（左边） <strong>== right-hand-side</strong>（右边） 和作为第二个参数提供的未知变量(或多个变量)。结果作为<strong>规则</strong>输出。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Solve[x^2 - 2 x - 3 == 0, x]</code></pre>
<!-- /wp:code -->

<pre><code>{{x -> -1}, {x -> 3}}</code></pre>

<!-- wp:code -->

<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z84P6csNboizkhBV8FIoQJIGivY2ioY6ChUxP7//1@3oCgzrwQA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 上面提到的Solve可以使用单个表达式，也可以使用一组表达式或多个表达式用&amp;&amp;连接。正如你所期望的，解决方案可以以符号形式找到 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Solve&#91;{a x + 2 y == 7, 3 b x - y == 1}, {x, y}]
Solve&#91;a x + 2 y == 7 &amp;&amp; 3 b x - y == 1, {x, y}]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>{{x -> 9/(a + 6 b), y -> -((a - 21 b)/(a + 6 b))}}
{{x -> 9/(a + 6 b), y -> -((a - 21 b)/(a + 6 b))}}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z84P6csNbo6UaFCQVvBSKFSwdZWwVxHwVghCSiiC@Eb1uooVFfoKFTWxurrBxRl5pVwQbSh6lJQU0PTh67t////ugUgBgA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>讨论</h3>
<!-- /wp:heading -->

<!-- wp:heading {"level":4} -->
<h4><strong>Reduce</strong></h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> Solve用在<strong>线性和多项式方程最有效</strong>。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">对于包含<strong>约束、不等式或非代数表达式</strong>的表达式，应该使用Reduce。</p>
<!-- /wp:paragraph -->

<!-- wp:mdx/warning {"title":"说明","content":"在Mathematica 8.0以后，Solve将得到增强，以覆盖更大的一类问题，从而减少了Reduce的需要!) "} -->
<blockquote class="wp-block-mdx-warning mdx-warning"><p><i class="mdui-icon material-icons"></i> 说明<br/><strong>在Mathematica 8.0以后，Solve将得到增强，以覆盖更大的一类问题，从而减少了Reduce的需要!) </strong></p></blockquote>
<!-- /wp:mdx/warning -->

<!-- wp:code -->
<pre><code>Reduce&#91;x > 0 &amp;&amp; x^2 - 2 x - 3 == 0, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>x == 3</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z8oNaU0OTW6QsFOwUBBTU2hIs5IQVfBSKECSBor2NoqGOgoVMT@//9ft6AoM68EAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> Reduce<strong>不使用规则</strong>，因为它可能需要用<strong>区间</strong>来表示。</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Reduce&#91;x > 0 &amp;&amp; x^2 &lt; 2, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>0 &lt; x &lt; Sqrt&#91;2]</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z8oNaU0OTW6QsFOwUBBTU2hIs5IwUbBSEehIvb///@6BUWZeSUA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4> FindRoot </h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 当你正在寻找数值解决方案的时候用FindRoot是很好的，并提供了一个起点，你希望Mathematica搜索。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> FindRoot是一种数值方法，因此它可以求解更大的一类表达式，尽管它不能保证收敛。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>FindRoot&#91;x^2 - 2 x - 3, {x, -3}](*-3表示从-3开始找根*)
FindRoot&#91;x^2 - Exp&#91;2 x] - 3 == x, {x, 0}]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>{x -> -1.}
{x -> -1.32237}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/98tMy8lKD@/JLoizkhBV8FIoQJIGusoVFfoKOga18ZqaOkav1i44vmSXU929@kaP93T8HR597POfc8W7NTS1NcPKMrMK@FCM8S1oiAaaFAsyCQFW1uFCohxBrWxUA3////XLQAxAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>2.给了根，求多项式</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3>问题</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 你已经有根了，需要找多项式</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>解决方案</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 使用MinimalPolynomia找到以给定值为根的最小多项式(最小次)。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>ploy = MinimalPolynomial&#91;Sqrt&#91;2] + Sqrt&#91;5], x]
Last&#91;Solve&#91;ploy == 0, x]] // FullSimplify</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>9 - 14 x^2 + x^4
{x -> Sqrt&#91;2] + Sqrt&#91;5]}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##LYw9C8IwEEB3f8XNaqmWOjhkdapQyBhSOKTiweXDGiX59Wcjbm947zlMj9lhohuKRA4FFFzJk0MeAxcfHCEb/VyS6Szs4Ecnu4ds23ZcyKfNgK9kdODPbOpAnaGBY7/NU7f6eepBKTjUYC0ub2ZNLjLdC/wHItLECl8" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>讨论</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 正如你所期望的，复数也是可以的。</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>MinimalPolynomial&#91;2 + I, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>5 - 4 x + x^2</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/983My8zNzEnID@nMi8/NzMxJ9pIQVvBU0ehIvb///@6BUWZeSUA" target="_blank" rel="noopener">TTry it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">  数字必须是<strong>显式的数字</strong>，否则你会得到一个错误。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">试图使用带有Pi的 MinimalPolynomia是注定要失败的，因为Pi是一个超越数，但是Pi的合理近似值也失败了，因为它不是显式代数的。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>MinimalPolynomial&#91;Pi, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>\&#91;Pi] 不是一个显式代数数.
MinimalPolynomial&#91;\&#91;Pi], x]</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/983My8zNzEnID@nMi8/NzMxJzogU0ehIvb///@6BUWZeSUA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>MinimalPolynomial&#91;3.14, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>3.14` 不是一个显式代数数.
MinimalPolynomial&#91;3.14, x]</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/983My8zNzEnID@nMi8/NzMxJ9pYz9BER6Ei9v///7oFRZl5JQA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 使用Rationalize来绕过这个限制 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>MinimalPolynomial&#91;Rationalize@3.14, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>-157 + 50 x</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/983My8zNzEnID@nMi8/NzMxJzoIKJOfl5iTWZXqYKxnaKKjUBH7//9/3YKizLwSAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:mdx/warning {"title":"关于“显式代数数”","content":"关于这一点我对mma的处理有一点怀疑态度。"} -->
<blockquote class="wp-block-mdx-warning mdx-warning"><p><i class="mdui-icon material-icons"></i> 关于“显式代数数”<br/><strong>关于这一点我对mma的处理有一点怀疑态度。</strong></p></blockquote>
<!-- /wp:mdx/warning -->

<!-- wp:heading -->
<h2>3. 将表达式转换为其他形式 </h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3>问题</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 你有一个符号表达式，希望将其转换为另一种形式。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">当你从Mathematica计算中得到一个你不想要的形式的结果时，一个常见的要求是简化表达式 </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>解决方案</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 两个最重要的符号转换是Simplify和  FullSimplify。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">这些函数试图对表达式应用代数和其他转换，将其转换为包含较少符号的等价形式。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> Simplify和   FullSimplify 的主要区别在于</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">   FullSimplify 将考虑更大的转换集，包括特殊的函数。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">因此，<strong>   FullSimplify 通常更有效</strong>，<strong>但也更慢</strong>。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">在这里，Simplify和FullSimplify最终得到的答案是一样的，但是   FullSimplify 需要超过一分钟，而 Simplify马上完成了。</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Timing&#91;Simplify&#91;Sin&#91;(x + y + z)^2] Cos&#91;(z + y + x)^2]]]
Timing&#91;FullSimplify&#91;Sin&#91;(x + y + z)^2] Cos&#91;(z + y + x)^2]]]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>{0.921875, 1/2 Sin&#91;2 (x + y + z)^2]}
{38.25, 1/2 Sin&#91;2 (x + y + z)^2]}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z8kMzczLz06ODO3ICczrRLIyIvWqFDQVqgE4irNOKNYBef84miNKqhQBUgoNlZfP6AoM6@EC6rdrTQnh0wj/v//r1sAYgAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>讨论</h3>
<!-- /wp:heading -->

<!-- wp:heading {"level":4} -->
<h4>Together</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">  Simplify和  FullSimplify执行完全自动化的简化。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">然而，你有时希望应用更多的目标转换。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">例如，一个常见的转换是把一个公分母上的和放在一起。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Together&#91;a/(a^2 + b^2 + c^2) + b/(a^2 + b^2 + c^2) + 
  c/(a^2 + b^2 + c^2)]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>(a + b + c)/(a^2 + b^2 + c^2)</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z8kPz0VyC2KTtTXSIwzUtBWSAKTyXFGmiAOVlEuBYVkTInY////6xYUZeaVAAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>Apart</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">  Apart是另一个有用的转换，它将表达式表示为<strong>部分分式的和。 </strong></p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Apart&#91;4/((1 + x) (5 + x))]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>1/(1 + x) - 1/(5 + x)</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/9@xILGoJNpEX0PDUEFboUJTQcMUTGvG/v//X7egKDOvBAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>Factor、FactorTerms、FactorSquareFree、Expand和ExpandAll </h4>
<!-- /wp:heading -->

<!-- wp:code -->
<pre><code>Factor&#91;21 - 4 x - x^2]
Expand&#91;(x + 1)^3]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>-(-3 + x) (7 + x)
1 + 3 x + 3 x^2 + x^3</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/98tMbkkvyjayFBBV8FEoQJIVsQZxerrBxRl5pVwuVYUJOalRGtUKGgrGGrGGcMk/v//r1sAYgAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> ExpandAll与Expand类似，但 ExpandAll涉及更多的表达式。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">例如，涉及Sin或Exp等函数的参数。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><strong>请注意</strong>，Expand对<strong>嵌套多项式</strong>没有作用，但 ExpandAll有作用。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"backgroundColor":"light-green-cyan","className":"is-style-text-indent-2em"} -->
<p class="has-background has-light-green-cyan-background-color is-style-text-indent-2em">比如说我们要把Sin[(x+1)^2]里面的(x+1)^2展开 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Expand&#91;Sin&#91;(x+1)^2]]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>Sin&#91;(1 + x)^2]</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/9@1oiAxLyU6ODMvWqNC21Azzig29v///7oFRZl5JQA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">看见没有Expand命令不起作用</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">现在换成 ExpandAll </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>ExpandAll&#91;Sin&#91;(x+1)^2]]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>Sin&#91;1 + 2 x + x^2]</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/9@1oiAxL8UxJyc6ODMvWqNC21Azzig29v///7oFRZl5JQA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 你还可以分别使用ExpandNumerator和ExpandDenominator将展开范围缩小到表达式的分子或分母 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>With&#91;{expr = (1 + x)^2/(2 + 3 x)^3}, 
 Row&#91;{ExpandNumerator&#91;expr], ExpandDenominator&#91;expr]}, 
  Invisible&#91;expr]]]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>(1+2 x+x^2)/(2+3 x)^3(1+x)^2/(2+3 x)^3(1+x)^2/(8+36 x+54 x^2+27 x^3)</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z88syQjujq1oqBIwVZBw1BBW6FCM85IX8MIyDIGsY1rdRS4FILyy6OrXSsKEvNS/EpzU4sSS/KLokG6YnUUIMIuqXn5uZl5CAmwPgXPvLLM4syknFSIYGzs////dQuKMvNKAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>Collect</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> Collect做拓展的工作，但也收集一些变量的匹配权项。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">比较这里给出的展开和收集的结果 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Expand&#91;(a + x)^2 (b + x)^3]
Collect&#91;(a + x)^2 (b + x)^3, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>a^2 b^3 + 3 a^2 b^2 x + 2 a b^3 x + 3 a^2 b x^2 + 6 a b^2 x^2 + 
 b^3 x^2 + a^2 x^3 + 6 a b x^3 + 3 b^2 x^3 + 2 a x^4 + 3 b x^4 + x^5

a^2 b^3 + (3 a^2 b^2 + 2 a b^3) x + (3 a^2 b + 6 a b^2 + 
    b^3) x^2 + (a^2 + 6 a b + 3 b^2) x^3 + (2 a + 3 b) x^4 + x^5</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/9@1oiAxLyVaI1FBW6FCM85IQSMJwjKO1dcPKMrMK@Fyzs/JSU0uwaZGR6ECpuz///@6BSAGAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>FactorTerms</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> FactorTerms因式分解出数值项或不依赖于特定变量的项 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>FactorTerms&#91;Expand&#91;(3 + 3 x)^2]]
Expand&#91;(y + y x)^3]
FactorTerms&#91;Expand&#91;(y + y x)^3], y]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>9 (1 + 2 x + x^2)
y^3 + 3 x y^3 + 3 x^2 y^3 + x^3 y^3
(1 + 3 x + 3 x^2 + x^3) y^3</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/98tMbkkvygktSi3ONq1oiAxLyVaw1hBW8FYoUIzzig2Vl8/oCgzr4QLJlcJlKsEyRnDpbAZgaRMR6ESpvT///@6BSAGAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>三角变换TrigFactor、TrigExpand、TrigExpandAll和TrigReduce。 </h4>
<!-- /wp:heading -->

<!-- wp:code -->
<pre><code>TrigFactor&#91;Sin&#91;3 x]]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>(1 + 2 Cos&#91;2 x]) Sin&#91;x]</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 通过使用三角恒等式展开表达式，TrigExpand删除了参数中的<strong>和</strong>和<strong>乘积</strong> </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>TrigExpand&#91;Sin&#91;3 x + 1]]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>Cos&#91;x]^3 Sin&#91;1] + 3 Cos&#91;1] Cos&#91;x]^2 Sin&#91;x] - 
 3 Cos&#91;x] Sin&#91;1] Sin&#91;x]^2 - Cos&#91;1] Sin&#91;x]^3</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z@kKDPdtaIgMS8lOjgzL9pYoULbMDb2////ugVFmXklAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> TrigReduce对一个表达式进行转换，使其在三角函数项中是<strong>线性</strong>的(没有幂函数或两个不同的三角函数的乘法)。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>TrigReduce&#91;Sin&#91;3 x]^2 Cos&#91;2 x]]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>1/4 (2 Cos&#91;2 x] - Cos&#91;4 x] - Cos&#91;8 x])</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z@kKDM9KDWlNDk1OjgzL9pYoSI2zkjBOb842gjIjP3//79uQVFmXgkA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>4. 生成多项式 </h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3>问题</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 你想要得到一个特定次数的多项式。 </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>解决方案</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 一个简单的解决方案使用Sum和Subscript这里我生成了一个四次多项式。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Sum&#91;Subscript&#91;a,i]x^i,{i,0,4}]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>Subscript&#91;a, 0] + x Subscript&#91;a, 1] + x^2 Subscript&#91;a, 2] + 
 x^3 Subscript&#91;a, 3] + x^4 Subscript&#91;a, 4]</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z@4NDc6uDSpOLkos6AkOlEnM7YiLlOnOlPHQMekNvb///@6BUWZeSUA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3> 讨论 </h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 如果，除了次数，你不关心多项式的特殊形式，那么解是正确的。然而，如果你想指定系数，你可以用Dot生成一个多项式。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Clear&#91;makePloy];
SetAttributes&#91;makePloy, HoldRest];
makePloy&#91;coef_List, var_ : x] := 
  Dot&#91;Table&#91;var^i, {i, 0, Length&#91;coef] - 1}], coef];
makePloy&#91;{a, b, c, d, e}]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>a + b x + c x^2 + d x^3 + e x^4</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##TYyxCsIwGIT3PsU9QAq6VhxEB4cOom4hlr/11wbTRtJfUUqfPZaC4nDD3Xd3DUnNDYmtKMa1Ywq6oRvvnH@bRXJgWYkEWz6Eux9Q2Hp33nMnY@Ub6srzpchtJwpPCgUyvAyyJRJg40UfqXSsR3KyCv2omULO7VXqaWmQYj4Yhcn83fakUI6xwlmBBxNjTO/BtvIB" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 许多数学教科书显示多项式的次数从<strong>最高到最低的</strong>顺序，我们要产生这种效果。用Inner替换Dot，并使用HoldForm，这样求和就不会被Mathematica重新排序。</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Clear&#91;makePloy2];
SetAttributes&#91;makePloy2, HoldRest];
makePloy2&#91;coef_List, var_ : x] := 
  Inner&#91;Times, Table&#91;var^i, {i, Length@coef - 1, 0, -1}], coef, 
   HoldForm&#91;Plus@##] &amp;];
makePloy2&#91;{a, b, c, d, e}]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>a x^4+b x^3+c x^2+d x+e</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##VY3BC0FBGMTv/oop5fS9wpEUKVEOwm1b2seHze572v2I5G9f7zmQw1xmfjPjjZzYG7E7k9LYsQnKmzMvXPno6n5jxTISCTa/CsdfQpiWbr/kKBXzddWu5MN2bqMQbiZs0cNdozdAA5gVBQe1tp4jYW1yx6pCNpbwrDTn4iinYd1Hhg6hTcg6L02oLaoHPo@TMni1cNc4bDY1Wn/nT0PIqwJhT@CXTilll2ALeQM" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>5. 将多项式分解成它们的组成部分 </h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3>问题</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 你想从一个给定的多项式中提取一组系数、单项式或变量。 </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>解决方案</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">分解多项式的两个有用的函数是CoefficientList 和MonomialList，首先我生成一个多项式 。</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>ploy2 = Sum&#91;Subscript&#91;a, i] x^i, {i, 0, 6}]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>Subscript&#91;a, 0] + x Subscript&#91;a, 1] + x^2 Subscript&#91;a, 2] + 
 x^3 Subscript&#91;a, 3] + x^4 Subscript&#91;a, 4] + x^5 Subscript&#91;a, 5] + 
 x^6 Subscript&#91;a, 6]</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/78gJ7/SSMFWIbg0Nzq4NKk4uSizoCQ6UUchM1ahIi5TR6EaiA10FMxqY////69bUJSZVwIA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 利用CoefficientList提取系数表 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>CoefficientList&#91;ploy2, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>{Subscript&#91;a, 0], Subscript&#91;a, 1], Subscript&#91;a, 2], Subscript&#91;a, 3], \
Subscript&#91;a, 4], Subscript&#91;a, 5], Subscript&#91;a, 6]}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/985PzUtLTM5MzWvxCezuCQ6uDQXiJOKk4syC0qiE3UUMmMVKuIydRSqgdhAR8GsNlZHoSL2////ugVFmXklAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> MonomialList给出多项式 poly2中所有单项式的列表.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>MonomialList&#91;ploy2]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>{Subscript&#91;a, 0], x^6 Subscript&#91;a, 6], x^5 Subscript&#91;a, 5], 
 x^4 Subscript&#91;a, 4], x^3 Subscript&#91;a, 3], x^2 Subscript&#91;a, 2], 
 x Subscript&#91;a, 1]}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/983Py8/NzMxxyezuCQ6uDQXiJOKk4syC0qiE3UUMmMVKuIydRSqgdhAR8GsNlZHoSL2////ugVFmXklAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 如果你只想要多项式的变量，就使用Variables</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Variables&#91;(a x + b y)^2]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>{a, x, b, y}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z8ssSgzMSkntThaI1GhQkFbIUmhUjPOKPb///@6BUWZeSUA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>讨论</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 除了 CoefficientList之外，您还可以使用 Coefficient提取你所需要的表达式的系数。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Coefficient&#91;1 + 2 x^2 + x^4 + 4 x^3, x^2] </code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>2</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/985PzUtLTM5MzWvJNpQQVvBSKEizghIV8SZAEkTIG2sAxKKVfj//79uQVFmXgkA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 系数也采用第三个参数，它指定第二个参数的幂。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">同样的提取过程可以这样做。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Coefficient&#91;1 + 2 x^2 + x^4 + 4 x^3, x，2] </code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>2</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> <a href="https://tio.run/##y00syUjNTSzJTE78/985PzUtLTM5MzWvJNpQQVvBSKEizghIV8SZAEkTIG2so1ChYxSr8P//f92Cosy8EgA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">同样的，你也可以提取常数项。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>Coefficient&#91;1 + 2 x^2 + x^4 + 4 x^3, x, 0]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>1</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/985PzUtLTM5MzWvJNpQQVvBSKEizghIV8SZAEkTIG2so1ChYxCr8P//f92Cosy8EgA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>函数MonomialList的其他参数</h4>
<!-- /wp:heading -->

<!-- wp:code -->
<pre><code>ploy3 = Expand&#91;(x + 2)^2 (y + 3)^3]；
MonomialList&#91;ploy3, {x, y}, "DegreeLexicographic"]
MonomialList&#91;ploy3, {x, y}, "Lexicographic"]
MonomialList&#91;ploy3, {x, y}, "NegativeDegreeLexicographic"]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>{x^2 y^3, 9 x^2 y^2, 4 x y^3, 27 x^2 y, 36 x y^2, 4 y^3, 27 x^2, 
 108 x y, 36 y^2, 108 x, 108 y, 108}
{x^2 y^3, 9 x^2 y^2, 27 x^2 y, 27 x^2, 4 x y^3, 36 x y^2, 108 x y, 
 108 x, 4 y^3, 36 y^2, 108 y, 108}
{108, 108 x, 108 y, 27 x^2, 108 x y, 36 y^2, 27 x^2 y, 36 x y^2, 
 4 y^3, 9 x^2 y^2, 4 x y^3, x^2 y^3}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">可以用HoldForm来把按照顺序的表达式显示出来。</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>HoldForm&#91;Plus&#91;##]] &amp; @@ MonomialList&#91;ploy3, {x, y}, "Lexicographic"]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>x^2 y^3+9 x^2 y^2+27 x^2 y+27 x^2+4 x y^3+36 x y^2+108 x y+108 x+4 y^3+36 y^2+108 y+108</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##DcZBCoMwEADArywKRWl60Q94aenBQu8hwhKlLiTZEFOIFN@@dk7jMa@Lx0wWRZ7s5gcnr9/uu@m6NgYuMAzw4sCe0I20ZX0vEcOsmwJX6Nqpg2b/r2@n3ij4FQX7oaAal0KWPwnjSrYyInKLiUI@AQ" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>6. 多项式除以多项式 </h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3>问题</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 你想要除多项式，找到余数，最大公约数(GCD)，或最小公倍数(LCM)。 </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>解决方案</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 使用PolynomialQuotient或PolynomialRemainder。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">如果两者都需要，可以使用PolynomialQuotientRemainder。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>PolynomialQuotient&#91;x^3 + x^2 - x + 1, x + 1, x]
PolynomialRemainder&#91;x^3 + x^2 - x + 1, x + 1, x]
PolynomialQuotientRemainder&#91;x^3 + x^2 - x + 1, x + 1, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>-1 + x^2

2

{-1 + x^2, 2}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z8gP6cyLz83MzEnsDS/JDM1ryS6Is5YQVuhIs5IQVehAsgy1IFTsfr6AUWZeSVcCG1BQKMy81JSi0jUB7OOJP3////XLQAxAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>讨论</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> Mathematica还提供了多项式PolynomialMod ，它使用基于重复减法的算法，因此，从不执行除法</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>With&#91;{ploy4 = x^3 + x^2 - x + 1, divisor = x^2}, 
 Simplify&#91;ploy4 - (divisor*PolynomialQuotient&#91;ploy4, divisor, x])] == 
  PolynomialRemainder&#91;ploy4, divisor, x]]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>True</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##bY47CgIxGIR7TzGlj03haps76FpYLBGCG9kf8iJGSRDPHoMr2tgMA/PNMEbGURkZ6SxLOVIc@4fXLm/BkU4brKq2YEjVrRsMdKerC@@wfTaY4UDGa7rkfmoxzD/Mcud0ts6Q1Pubi6RsnJjvSoMkFgKc1xn86K7eITuo8AcXpRTmA9n4Ag" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 在许多情况下，多项式模 PolynomialMod 和多项式 余数PolynomialRemainder 将返回相同的结果。特别是对于一元有理多项式，多项式的余式与多项式的余式是相同的.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 如果除数是常数或多元数，函数的工作方式就不同。</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em">在多项式模 PolynomialMod 的情况下，常数m减少系数模m，而多项式余数 PolynomialRemainder  总是0。  </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>PolynomialMod&#91;13 x^3 + 15 x^2 - 5 x + 7, 7]
PolynomialRemainder&#91;x^3 + x^2 - X + 1, 7, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>2 x + x^2 + 6 x^3

0</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z8gP6cyLz83MzHHNz8l2tBYoSLOWEFbwdAUyDBS0FUA0kCuuY6Ceay@fkBRZl4JF0JLENCYzLyU1KJoiC6IlgiQfh2QngqYnv///@sWgBgA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"> 在多元情况下，多项式根据OrderedQ确定变量的顺序。 </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre><code>PolynomialMod&#91;a x^3 + 2 a x^2 - 5 a x + 1, x + a]
PolynomialRemainder&#91;a x^3 + 2 a x^2 - 5 a x + 1, x + a, x]</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre><code>1 + 5 x^2 - 2 x^3 - x^4
1 + 5 a^2 + 2 a^3 - a^4</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"className":"is-style-text-indent-2em"} -->
<p class="is-style-text-indent-2em"><a href="https://tio.run/##y00syUjNTSzJTE78/z8gP6cyLz83MzHHNz8lOlGhIs5YQVvBSAHEMlLQVTAFsYAihjpgKjFWXz@gKDOvhAuhMQhoWGZeSmoREdqBFMyE////6xaAGAA" target="_blank" rel="noopener">Try it online!</a></p>
<!-- /wp:paragraph -->
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://wxyhgk.gitee.io" rel="external nofollow noreferrer">我心永恆</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://wxyhgk.gitee.io/mma-algebra/">https://wxyhgk.gitee.io/mma-algebra/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="https://wxyhgk.gitee.io" target="_blank">我心永恆</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/%E6%95%99%E7%A8%8B/">
                                    <span class="chip bg-color">教程</span>
                                </a>
                            
                                <a href="/tags/Mathematica/">
                                    <span class="chip bg-color">Mathematica</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    
    <div class="social-share" data-sites="qq,qzone,wechat,weibo,douban" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>
            
        </div>
    </div>

    

    

    

    

    
        <style>
    .valine-card {
        margin: 1.5rem auto;
    }

    .valine-card .card-content {
        padding: 20px 20px 5px 20px;
    }

    #vcomments textarea {
        box-sizing: border-box;
        background: url("/medias/comment_bg.png") 100% 100% no-repeat;
    }

    #vcomments p {
        margin: 2px 2px 10px;
        font-size: 1.05rem;
        line-height: 1.78rem;
    }

    #vcomments blockquote p {
        text-indent: 0.2rem;
    }

    #vcomments a {
        padding: 0 2px;
        color: #4cbf30;
        font-weight: 500;
        text-decoration: none;
    }

    #vcomments img {
        max-width: 100%;
        height: auto;
        cursor: pointer;
    }

    #vcomments ol li {
        list-style-type: decimal;
    }

    #vcomments ol,
    ul {
        display: block;
        padding-left: 2em;
        word-spacing: 0.05rem;
    }

    #vcomments ul li,
    ol li {
        display: list-item;
        line-height: 1.8rem;
        font-size: 1rem;
    }

    #vcomments ul li {
        list-style-type: disc;
    }

    #vcomments ul ul li {
        list-style-type: circle;
    }

    #vcomments table, th, td {
        padding: 12px 13px;
        border: 1px solid #dfe2e5;
    }

    #vcomments table, th, td {
        border: 0;
    }

    table tr:nth-child(2n), thead {
        background-color: #fafafa;
    }

    #vcomments table th {
        background-color: #f2f2f2;
        min-width: 80px;
    }

    #vcomments table td {
        min-width: 80px;
    }

    #vcomments h1 {
        font-size: 1.85rem;
        font-weight: bold;
        line-height: 2.2rem;
    }

    #vcomments h2 {
        font-size: 1.65rem;
        font-weight: bold;
        line-height: 1.9rem;
    }

    #vcomments h3 {
        font-size: 1.45rem;
        font-weight: bold;
        line-height: 1.7rem;
    }

    #vcomments h4 {
        font-size: 1.25rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    #vcomments h5 {
        font-size: 1.1rem;
        font-weight: bold;
        line-height: 1.4rem;
    }

    #vcomments h6 {
        font-size: 1rem;
        line-height: 1.3rem;
    }

    #vcomments p {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    #vcomments hr {
        margin: 12px 0;
        border: 0;
        border-top: 1px solid #ccc;
    }

    #vcomments blockquote {
        margin: 15px 0;
        border-left: 5px solid #42b983;
        padding: 1rem 0.8rem 0.3rem 0.8rem;
        color: #666;
        background-color: rgba(66, 185, 131, .1);
    }

    #vcomments pre {
        font-family: monospace, monospace;
        padding: 1.2em;
        margin: .5em 0;
        background: #272822;
        overflow: auto;
        border-radius: 0.3em;
        tab-size: 4;
    }

    #vcomments code {
        font-family: monospace, monospace;
        padding: 1px 3px;
        font-size: 0.92rem;
        color: #e96900;
        background-color: #f8f8f8;
        border-radius: 2px;
    }

    #vcomments pre code {
        font-family: monospace, monospace;
        padding: 0;
        color: #e8eaf6;
        background-color: #272822;
    }

    #vcomments pre[class*="language-"] {
        padding: 1.2em;
        margin: .5em 0;
    }

    #vcomments code[class*="language-"],
    pre[class*="language-"] {
        color: #e8eaf6;
    }

    #vcomments [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
        position: inherit;
        margin-left: -1.3rem;
        margin-right: 0.4rem;
        margin-top: -1px;
        vertical-align: middle;
        left: unset;
        visibility: visible;
    }

    #vcomments b,
    strong {
        font-weight: bold;
    }

    #vcomments dfn {
        font-style: italic;
    }

    #vcomments small {
        font-size: 85%;
    }

    #vcomments cite {
        font-style: normal;
    }

    #vcomments mark {
        background-color: #fcf8e3;
        padding: .2em;
    }

    #vcomments table, th, td {
        padding: 12px 13px;
        border: 1px solid #dfe2e5;
    }

    table tr:nth-child(2n), thead {
        background-color: #fafafa;
    }

    #vcomments table th {
        background-color: #f2f2f2;
        min-width: 80px;
    }

    #vcomments table td {
        min-width: 80px;
    }

    #vcomments [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
        position: inherit;
        margin-left: -1.3rem;
        margin-right: 0.4rem;
        margin-top: -1px;
        vertical-align: middle;
        left: unset;
        visibility: visible;
    }
</style>

<div class="card valine-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="vcomments" class="card-content" style="display: grid">
    </div>
</div>

<script src="/libs/valine/av-min.js"></script>
<script src="/libs/valine/Valine.min.js"></script>
<script>
    new Valine({
        el: '#vcomments',
        appId: '8i5IVUkUwJXeA2lmcXHA1oya-gzGzoHsz',
        appKey: '8VLP3WBVp7k20K81z9qUxg1i',
        notify: 'false' === 'true',
        verify: 'false' === 'true',
        visitor: 'true' === 'true',
        avatar: 'mm',
        pageSize: '10',
        lang: 'zh-cn',
        placeholder: 'just go go'
    });
</script>

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/mma-rulepattern2/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/5.jpg" class="responsive-img" alt="Mathematica——规则模式2">
                        
                        <span class="card-title">Mathematica——规则模式2</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            1.2.5 反复应用规则——ReplaceRepeated函数由于任何给定的规则或规则列表通常只在表达式的任何元素上作用一次，所以它们不会“跟踪”由它们自己的操作导致的表达式中的更改。通过反复将规则或规则列表应用于表达式直到其停止更改，可以
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-03-20
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-user fa-fw"></i>
                            我心永恆
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/%E6%95%99%E7%A8%8B/">
                        <span class="chip bg-color">教程</span>
                    </a>
                    
                    <a href="/tags/Mathematica/">
                        <span class="chip bg-color">Mathematica</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/mma-list/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/20.jpg" class="responsive-img" alt="Mathematica——列表操作">
                        
                        <span class="card-title">Mathematica——列表操作</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                             1.1介绍 



在Mathematica中，列表是主要的数据结构，在LISP等函数式编程语言中也是如此。任何复杂的数据结构都可以表示为一些(可能是复杂的和嵌套的)列表。例如，n维数组表示为深度为n的列表。



列表可以在程序执行过程
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-03-14
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-user fa-fw"></i>
                            我心永恆
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/%E6%95%99%E7%A8%8B/">
                        <span class="chip bg-color">教程</span>
                    </a>
                    
                    <a href="/tags/Mathematica/">
                        <span class="chip bg-color">Mathematica</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->


<!-- 代码块折行 -->


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('2'),
            headingSelector: 'h2, h3, h4, h5, h6'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4, h5, h6').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>



    <footer class="page-footer bg-color">
    
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            <span id="year">2019</span>
            <a href="https://wxyhgk.gitee.io" target="_blank">我心永恆</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">43.3k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">


    <a href="mailto:3123624718@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=3123624718" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 3123624718" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







</div>
    </div>
    <script src="/js/highlight.pack.js"></script>
    <script>hljs.initHighlightingOnLoad();</script>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
});
</script>
    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    
    <script type="text/javascript" color="0,0,255"
        pointColor="0,0,255" opacity='0.7'
        zIndex="-1" count="99"
        src="/libs/background/canvas-nest.js"></script>
    

    

    
    
    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
